# -*- coding: utf-8 -*-
import sys, os
if hasattr(sys, 'frozen'):
    os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH']
from PyQt5.QtWidgets import QApplication
from PyQt5.QtWidgets import QMainWindow
from main_window import Ui_MainWindow
from PyQt5.QtWidgets import QMessageBox
import sys

TOOL_VERSIONS = 'V1.0.0'


class GloabalUI(QMainWindow, Ui_MainWindow):  # 继承类
    app = QApplication(sys.argv)

    def __init__(self):
        super().__init__()
        self.setupUi(self)  # 执行类中的setupUi函数
        self.setWindowTitle("模块flash生成 " + TOOL_VERSIONS)
        self.msgBox = QMessageBox()

    def msg(self, msg):
        print(msg)
        self.msgBox.setText(msg)
        self.msgBox.exec()


ui = GloabalUI()
if __name__ == "__main__":
    ui.show()
    sys.exit(ui.app.exec_())
